package com.serviceImpl;

import com.bean.User;
import com.daoImpl.LoginDaoImpl;
import com.service.LoginService;

public class LoginServiceImpl implements LoginService {
	LoginDaoImpl loginDao;
	User user;

	@Override
	public String checkUser(String username, String password) {

		loginDao = new LoginDaoImpl();
		user = loginDao.getUser(username);
		if (user.getUsername() != null) {
			if (password.equals(user.getPassword())) {
				return "success";
			} else {
				return "error";
			}
		} else {
			return "register";
		}
	}

}
